package com.newblog.common;

import com.newblog.model.userinfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2023-12-11
 * Time:16:13
 * Text：
 */
public class SessionUtils {

    public static userinfo getUser(HttpServletRequest req){
        HttpSession session=req.getSession(false);
        if(session!=null && session.getAttribute(AppVarible.SESSION_USERINFO_KEY)!=null){
            return (userinfo)session.getAttribute(AppVarible.SESSION_USERINFO_KEY);
        }
        return null;
    }

}
